﻿namespace DimensionsHelper.LanguageService.Syntax;

public abstract class DmsSectionWithDescription : Declaration
{
    private StringLiteral? _description;

    internal DmsSectionWithDescription(SyntaxKinds kind, SyntaxToken declareKeywordToken, Identifier identifierName,
        StringLiteral? description, SyntaxNode? parent) :
        base(kind, declareKeywordToken, identifierName, parent)
    {
        SetChildNullableField(ref _description, StringLiteral.IsDefault, description);
    }


    public StringLiteral? Description => _description;


    public DmsSectionWithDescription Update(StringLiteral description)
    {
        SetChildNullableField(ref _description, StringLiteral.IsDefault, description);
        return this;
    }
}